% answer for 2.13.a
% A is the matrix of the question
% compute the dominant eigenvalue lamda and stable stage distribution w
% of the whale population

A = [   0   0.0043 0.1132    0;
     0.9975 0.9111    0      0;
        0   0.0736 0.9534    0;
        0      0   0.0452 0.9804];
[W,D]=eig(A);
[lamda,index]=max(diag(D));              %calculate lamda
w=W(:,index)                             %find the corresponding eigenvector
lamda